<?
require_once('Strings.php');
require_once('usaArreio.php');
require_once('ListaDeElementos.php');
require_once('Raca.php');
require_once('Objecto.php');
require_once('ObjEquipamento.php');
require_once('Actor.php');
require_once('Anao.php');
require_once('Dado.php');
require_once('Driade.php');
require_once('Elfo.php');
require_once('Gigante.php');
require_once('Humano.php');
require_once('Minotauro.php');
require_once('MortoVivo.php');
require_once('ObjArma.php');
require_once('ObjArmaMelee.php');
require_once('ObjArmaNatural.php');
require_once('ObjArmaPancada.php');
require_once('Orque.php');
require_once('Vampiro.php');

function getMod($value) {
	return $value & 1 ? $value - 11 : $value - 10;
}

function dropdownbox2($tablename, $fieldid, $fieldshow, $selected, $prompt, $formvar, $option) {
	$tempquery="SELECT * FROM $tablename ".$option;
	$tempresult=mysql_query($tempquery) or die(mysql_error());
	$tempnum=mysql_num_rows($tempresult);
	if($tempnum!=0){
		$i=0;
		$select_str="";
		//$select_str="<option selected value=\"0\"></option>";
		while ($i<$tempnum) {
			$temp=mysql_result($tempresult,$i,"$fieldshow");
			$tempid=mysql_result($tempresult,$i,"$fieldid");
			if ($selected==$i) {
				$actualfile=$tempid;
				$select_str.="<option selected value=\"$tempid\">$temp</option>";
			} else $select_str.="<option value=\"$tempid\">$temp</option>";
			$i++;
		}
	} else $selected='';
	echo "$prompt<select name=\"$formvar\">$select_str</select>";
}
?>